Set up Python testing infrastructure with Poetry and pytest#127
Open
llbbl wants to merge 1 commit intosyrusakbary:masterfrom
Open
Set up Python testing infrastructure with Poetry and pytest#127llbbl wants to merge 1 commit intosyrusakbary:masterfrom
llbbl wants to merge 1 commit intosyrusakbary:masterfrom
Conversation
- Add Poetry package management with pyproject.toml configuration - Configure pytest with coverage reporting (80% threshold) - Add testing dependencies: pytest, pytest-cov, pytest-mock - Create test directory structure with unit/integration separation - Add shared fixtures in conftest.py for common test scenarios - Include validation tests to verify infrastructure setup - Update .gitignore with testing and development entries - Configure Poetry scripts for 'test' and 'tests' commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set up Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the
validate_emailPython project using Poetry for package management and pytest as the testing framework.Changes Made
Package Management
pyproject.tomlwith complete project metadata migrated fromsetup.pypytest(^8.0.0) - Core testing frameworkpytest-cov(^5.0.0) - Coverage reportingpytest-mock(^3.14.0) - Mocking utilitiesTesting Configuration
pytest Configuration:
test_*.pyand*_test.pyfilesunit,integration, andslowCoverage Configuration:
validate_emailmoduleDirectory Structure
Shared Fixtures (conftest.py)
temp_dir: Temporary directory for test filesmock_email_config: Mock email configuration datamock_dns_resolver: Mock DNS resolver for MX lookupsmock_smtp_connection: Mock SMTP connectionsample_mx_records: Sample MX record datanetwork_timeout: Standard timeout valuetest_data_dir: Path to test data directoryDevelopment Commands
poetry run test- Run all testspoetry run tests- Alternative command (both work)Additional Updates
.gitignorewith:.pytest_cache/,.coverage,htmlcov/, etc.)poetry.lockfrom gitignore as recommended).claude/*)How to Use
Install dependencies:
Run tests:
Run specific test categories:
Generate coverage reports:
htmlcov/index.htmlcoverage.xmlNotes